import Vue from "vue";
import Router from "vue-router";
import Login from "@/views/login";
import Home from "@/components/Home/Home.vue";
import Manager from "@/components/Manager/Manager.vue";
import Vplay from "@/components/Video/VideoPlay.vue";
import Hp from "@/components/HPerson/Hp";
import Homep from "@/views/homep";
import Audit from "@/views/audit";
import Classify from "@/views/classify";
import Home0 from "@/views/staff/home0";
import Manager0 from "@/views/staff/manager";
import Complain from "@/views/complain";
import Video from "@/views/video";
import Hoperson from "@/views/hoperson";
import Myfocus from "@/views/myfocus";
import History from "@/views/history";

Vue.use(Router);

export default new Router({
  mode: "history",
  base: process.env.BASE_URL,
  routes: [
    {
      path: "/",
      redirect: "/login"
    },
    {
      path: "/login",
      name: "login",
      component: Login
    },
    {
      path: "/home",
      name: "home",
      component: Home
    },
    {
      path: "/hp",
      name: "Hp",
      component: Hp,
      redirect: "/hp/hoperson",
      children: [
        {
          path: "/hp/hoperson",
          component: Hoperson,
          meta: { title: "个人中心" }
        },
        {
          path: "/hp/video",
          component: Video,
          meta: { title: "我的视频" }
        },
        {
          path: "/hp/myfocus",
          component: Myfocus,
          meta: { title: "我的关注" }
        },
        {
          path: "/hp/history",
          component: History,
          meta: { title: "历史记录" }
        }
      ]
    },
    {
      path: "/manager",
      name: "manager",
      component: Manager,
      redirect: "/homep",
      children: [
        {
          path: "/homep",
          component: Homep,
          meta: { title: "首页" }
        }
      ]
    },
    {
      path: "/audit",
      // name: "Audit",
      component: Manager,
      children: [
        {
          path: "/",
          component: Audit,
          meta: { title: "待审核视频列表" }
        }
      ]
    },
    {
      path: "/classify",
      // name: "Classify",
      component: Manager,
      children: [
        {
          path: "/",
          component: Classify,
          meta: { title: "分类管理" }
        }
      ]
    },
    {
      path: "/staff/home0",
      component: Manager,
      children: [
        {
          path: "/",
          component: Home0,
          meta: { title: "普通会员" }
        }
      ]
    },
    {
      path: "/staff/manager",
      component: Manager,
      children: [
        {
          path: "/",
          component: Manager0,
          meta: { title: "管理人员" }
        }
      ]
    },
    {
      path: "/complain",
      component: Manager,
      children: [
        {
          path: "/",
          component: Complain,
          meta: { title: "审投诉视频管理" }
        }
      ]
    },
    {
      path: "/vplay",
      name: "Vplay",
      component: Vplay
    }
  ]
});
